package cep.web.person.beans;

import cep.web.repo.DefaultBaseInfo;
import cep.web.repo.NameHolder;
import cep.web.repo.PersonBaseInfo;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * User: golovin
 * Date: 18.06.13
 * Time: 20:21
 */
@Component
public class FloorBean {
    private List<NameHolder> floorList;
    private int currentFloor;
    private int currentPerson;
    private String imageFloor;
    private List<PersonBaseInfo> personList;
    private List<DefaultBaseInfo> itemList;
    private boolean oneClickToPerson = false;

    @Deprecated
    public PersonBaseInfo getPerson(int id) {
        if (personList == null) {
            return null;
        }
        for (PersonBaseInfo p: personList) {
            if (p.getId() == id) {
                return p;
            }
        }
        return null;
    }

    public List<NameHolder> getFloorList() {
        return floorList;
    }

    public void setFloorList(List<NameHolder> floorList) {
        this.floorList = floorList;
    }

    public int getCurrentFloor() {
        return currentFloor;
    }

    public void setCurrentFloor(int currentFloor) {
        this.currentFloor = currentFloor;
    }

    public String getImageFloor() {
        return imageFloor;
    }

    public void setImageFloor(String imageFloor) {
        this.imageFloor = imageFloor;
    }

    public List<PersonBaseInfo> getPersonList() {
        return personList;
    }

    public void setPersonList(List<PersonBaseInfo> personList) {
        this.personList = personList;
    }

    public List<DefaultBaseInfo> getItemList() {
        return itemList;
    }

    public void setItemList(List<DefaultBaseInfo> itemList) {
        this.itemList = itemList;
    }

    public boolean isOneClickToPerson() {
        return oneClickToPerson;
    }

    public void setOneClickToPerson(boolean oneClickToPerson) {
        this.oneClickToPerson = oneClickToPerson;
    }

    public int getCurrentPerson() {
        return currentPerson;
    }

    public void setCurrentPerson(int currentPerson) {
        this.currentPerson = currentPerson;
    }
}
